package com.yaorange.pojo;

import java.util.Date;
import java.util.Objects;

public class Customer {
    private String id;//编号
    private String name;//姓名
    private Date birthday;//生日
    private char gender;//性别
    private Date registTime;//注册时间

    public Customer(String id, String name, Date birthday, char gender, Date registTime) {
        this.id = id;
        this.name = name;
        this.birthday = birthday;
        this.gender = gender;
        this.registTime = registTime;
    }

    public Customer() {
    }

    @Override
    public String toString() {
        return "Customer{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", birthday=" + birthday +
                ", gender=" + gender +
                ", registTime=" + registTime +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public Date getRegistTime() {
        return registTime;
    }

    public void setRegistTime(Date registTime) {
        this.registTime = registTime;
    }

    //重写equal方法，只比较姓名，性别，生日
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customer customer = (Customer) o;
        return gender == customer.gender &&
                Objects.equals(name, customer.name) &&
                Objects.equals(birthday, customer.birthday);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, birthday, gender);
    }
}
